From 069d78ed31fc1c0a9cb7621d27fe10d7b974315b Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 26 Apr 2007 17:04:33 +0000 Subject: [PATCH] Append a '/' to directory names in the completion popup. (#431323, Maarten 2007-04-26 Matthias Clasen * gtk/gtkfilechooserentry.c: Append a '/' to directory names in the completion popup. (#431323, Maarten Maathuis) svn path=/trunk/; revision=17658 --- ChangeLog | 5 +++++ gtk/gtkfilechooserentry.c | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 384e05adc3..454797b6a3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2007-04-26 Matthias Clasen + + * gtk/gtkfilechooserentry.c: Append a '/' to directory names + in the completion popup. (#431323, Maarten Maathuis) + 2007-04-26 Matthias Clasen * demo/gtk-demo/combobox.c: Add a simple validation demo. diff --git a/gtk/gtkfilechooserentry.c b/gtk/gtkfilechooserentry.c index b5c12f0b47..24bbc5f32e 100644 --- a/gtk/gtkfilechooserentry.c +++ b/gtk/gtkfilechooserentry.c @@ -359,7 +359,7 @@ maybe_append_separator_to_path (GtkFileChooserEntry *chooser_entry, GtkFilePath *path, gchar *display_name) { - if (path) + if (!g_str_has_suffix (display_name, G_DIR_SEPARATOR_S) && path) { GtkFileInfo *info; @@ -377,7 +377,6 @@ maybe_append_separator_to_path (GtkFileChooserEntry *chooser_entry, gtk_file_info_free (info); } - } return display_name; @@ -572,9 +571,11 @@ update_current_folder_files (GtkFileChooserEntry *chooser_entry, NULL); /* NULL-GError */ if (info) { - const gchar *display_name = gtk_file_info_get_display_name (info); + gchar *display_name = g_strdup (gtk_file_info_get_display_name (info)); GtkTreeIter iter; + display_name = maybe_append_separator_to_path (chooser_entry, path, display_name); + gtk_list_store_append (chooser_entry->completion_store, &iter); gtk_list_store_set (chooser_entry->completion_store, &iter, DISPLAY_NAME_COLUMN, display_name, @@ -582,6 +583,7 @@ update_current_folder_files (GtkFileChooserEntry *chooser_entry, -1); gtk_file_info_free (info); + g_free (display_name); } } -- 2.30.2